package com.service.admin.member.controller;

import com.service.admin.member.controller.req.MemberJAPageReq;
import com.service.core.rest.BaseController;
import com.service.core.rest.response.CommonPageRep;
import com.service.core.rest.response.PageResponse;
import com.service.admin.member.service.MemberJAService;
import com.service.dao.model.JournalAccount;
import com.service.dao.po.MemberJAHRPo;
import com.service.dao.po.MemberJAPo;
import com.service.utility.common.UUIDUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <dl>
 * <dt>back-end</dt>
 * <dd>Description:</dd>
 * <dd>Copyright: Copyright (C) 2015</dd>
 * <dd>Company: </dd>
 * <dd>CreateDate: 2019年10月07日</dd>
 * </dl>
 *
 * @author
 */
@Slf4j
@Api(tags = "会员充值提币接口")
@RestController
@RequestMapping("member-ja")
public class MemberJAController extends BaseController {

    @Autowired
    private MemberJAService memberJAService;


    @ApiOperation("分页")
    @PostMapping("{memberId}/page")
    public PageResponse<MemberJAPo> page(@ApiParam @PathVariable("memberId") Integer memberId,
                                         @ApiParam @RequestBody MemberJAPageReq jaPageReq) {
        String uuid = UUIDUtil.randomUUID();
        log.info("请求开始 Msg: 请求参数：{}，UUID:{}", jaPageReq, uuid);
        jaPageReq.setMemberId(memberId);
        CommonPageRep<MemberJAPo> result = memberJAService.pageMemberJA(jaPageReq);
        log.info("请求结束： UUID:{}", uuid);
        return successQueryPageResponse(result);
    }



    @ApiOperation("算力流水分页")
    @PostMapping("hr-page")
    public PageResponse<MemberJAHRPo> hrPage(@ApiParam @RequestBody MemberJAPageReq jaPageReq){
        String uuid = UUIDUtil.randomUUID();
        log.info("请求开始 Msg: 请求参数：{}，UUID:{}", jaPageReq, uuid);
        CommonPageRep<MemberJAHRPo> result = memberJAService.pageMemberJAHR(jaPageReq);
        log.info("请求结束： UUID:{}", uuid);
        return successQueryPageResponse(result);
    }
}
